<template>
  <!-- 首页 -->
  <div id="index" class="index">
    <el-container style="height: 940px; border: 1px solid #eee">
      <el-aside width="200px" style="background-color: rgb(0, 0, 0)">
        <el-menu :default-openeds="['1']">
          <el-submenu index="1" @click.native="goCount">
            <template slot="title">
              <i class="el-icon-notebook-2"></i>
              <span>首页</span>
            </template>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-message"></i>
              <span>商品</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="2-1" @click.native="goShop">商品管理</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <el-menu-item index="2-2" @click.native="goShopclass">品类管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-folder-checked"></i>
              <span>订单</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="3-1" @click.native="goOrder">订单管理</el-menu-item>
              <!-- <el-menu-item index="3-2"></el-menu-item> -->
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="4">
            <template slot="title">
              <i class="el-icon-s-custom"></i>
              <span>用户</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="4-1" @click.native="gouser">用户列表</el-menu-item>
              <!-- <el-menu-item index="4-2">选项2</el-menu-item> -->
            </el-menu-item-group>
             <el-menu-item-group>
              <el-menu-item index="4-1" @click.native="goecharts">图表</el-menu-item>
            </el-menu-item-group>
            <el-menu-item-group>
              <el-menu-item index="4-1" @click.native="goBaidu">百度</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: right; font-size: 12px">
          <el-dropdown>
            <i class="el-icon-setting" style="margin-right: 15px"></i>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item>查看</el-dropdown-item>
              <el-dropdown-item>新增</el-dropdown-item>
              <el-dropdown-item>删除</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
          <span>zhh</span>
          <el-dropdown>
            <i class="el-icon-user-solid" style="margin-right: 15px"></i>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item @click.native="outlog">退出登录</el-dropdown-item>
              <el-dropdown-item @click.native="log">登陆</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </el-header>

        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  // 父辈向子辈传参
  props: [],
  name: "index",
  data() {
    return {};
  },
  created() {},
  computed: {},
  components: {},
  methods: {
    // 点击登录
    log() {
      this.$router.push("/login");
      console.log(1);
    },
    // 退出登录事件
    outlog() {
      localStorage.clear();
      this.$router.push("/login");
    },
    // 跳到首页统计页面
    goCount() {
      this.$router.push("/count");
      console.log(1);
    },
    // 跳转到用户列表
    gouser() {
      this.$router.push("/user");
    },
    // 跳转到订单页面
    goOrder() {
      this.$router.push("/order");
    },
    // 跳转到商品管理页面
    goShop() {
      this.$router.push("/shop");
    },
    goShopclass() {
      this.$router.push("/shopclass");
    },
    //跳转到用户图表
    goecharts(){
      this.$router.push("/echarts");
    },
    //跳转到百度地图
    goBaidu(){
      this.$router.push("/baidu");
    }
  },
  mounted() {},
  watch: {},
};
</script>
<style scoped lang="scss">
@import "@/Scss/index.scss";

.index {
  .el-container {
    height: 1000px;
  }
  .el-header {
    background-color: #cccccc;
    color: #ffffff;
    line-height: 60px;
  }
  .el-menu-item,
  .el-submenu__title {
    color: #0c0c0c;
  }
  .el-aside {
    color: #ffffff;
  }

  .el-menu {
    color: #ffffff;
    background: rgba(225, 225, 225, 0.1);
  }

  .el-main {
    margin-right: -15px;
    margin-left: -15px;
  }
  .el-menu-item[data-v-41509836],
  .el-submenu__title[data-v-41509836] {
    color: #333;
  }
  span {
    color: #b5b5b5;
  }
}
</style>